Fix commit function