add functionality to cancel button in editor