Fixed issue after refactoring