Work on database insertion