Modifying update profile function so it only runs DB update when there are changes ($data).