fix drawGrid bug