get_user_by logic added.