Write update hook for changes in entity