Fixed error made during refactoring