added debug-logging