update rectangle