added $q to mongo calls