added code for commiting records