make 'cancel' button work