fixed output to only print when debugging is enabled