made debug level configurable