Add safe mode support