fix bug introduced in previous refactoring