fixed bugs caused by refactoring