some changes in login logic