Fixed wheres building for elemMatch