database handling for view/update bug