Preventing unwanted closing