Added a new function to update value with a predicate