fix using patch from 231b60b0674dab2b33ba1ec770c40f57ca8f8288
update operations logic to work correctly with multiple associations