Added error checking for login page