fix many-many bugs