fixed error from refactoring part 1 actually finished