fixed bug introduced by refactoring