fixed debug mode errors