Fixed DB update bug