fix some debug info and added some better handling of updating