State mulls legal aid for prisoners