Update logic for user login