fixing another bug that my refactoring introduced