update rectangle js