Update function from master.