update method for rect class added