handle bad session name input. Also be more safe about accessing database and accepting user input
formatting
fixed some sql errors I recently introduced. Improved issue printing