fixed database class. again