Fixed error in previous refactoring