fix bug regarding refactoring