fixed database entity update