Added Function For database insertion