adding delete and commit functions