cancelButton works correctly