fix error in refactoring