fix #117 (add safemode setting, no gui yet)