debug for when update is called