fix the rect bug