refactored some updates, wrapped updates in try/finally to handle errors
better.