added login validation method