changed the query to match the new db structure
changed the query in index to match the new db structure