changed user login logic