Modified mongo queries so order of queries does not cause errors