changed debugging to use logger