add tests for safe mode