added createvalidrect method
added createvalidrect method