fixed DB update bug