better and more robust updating