fix errors after refactoring