Fixed key disabling code