upadte with new function