Cancel button now behaves as expected