Updated extension to rewrite when the object is resized