What's the need for committing at the end of the function?