added option to disable logging