fix issue where update was called twice