[ADDED] Error control for login.