fixed debug grid drawing bug