Fixed bug with the login sql