Fixing login validation