fixed database error