add commit function