fixing some debug errors