- fixed bugs after refactoring