Fixed after refactoring