added some better debugging