modfied user login function