fixed up the db script slightly