Fixed minor bug in login validation