Adding on_update method in lib