correct bug introduced by refactor