added a listener to the cancel button.