#442 fixed database insertion problem