Rule to avoid window close