fix refactor bug