adding "safe_mode" check