use session to store user_profile and clean up code for this change