Cancel button works the way it should