fixed debug errors