Added error checking to login screen