fixed get_profile function