Changed indexing for db