Fixing a bug and a bad query
Removed wip