fixed database index error