Attach handler to update model from dom changes