fix bug that after refactoring