Fixed login validation