check debug bool for logging