many to many working - pre function