bug fixes to login system