fixed the empty rects bug