added many to many save logic