missing check if debug flag was on before logging
more debug checking