Add support for safe mode