Moved queries into the catch

so we can see what we were trying to update in the event of an error