Return to previous state on cancel