updated script to create database