updating the ProfileId key in the ownerprofile table and some cleanup