Add commit function