update for $function