fixed DB update order