fix some debug issues