fix issue for many-many relations