add query for M2M