added login validation