make sure all id strings are cast to ObjectIds