added login validation.