update DrawRectangle function