update commit function