Added frontend validation for login