added try-catch to prevent crash in modes without the setting