fix group swap bug related to refactor