updated profile function