added logToConsole option