add basic support for safe mode