fixed newRectangle bug where width and height were not set