need to check len of rects before changing