fixed database script