fix bug introduced with latest refactoring