Implement gb_trees:modify/3 function to update the value using fun