fixed database creation bug