#443 fix in database insertion