Added logic to confirm switch off