Added the listener for the commit button.