added profile update logic