fix errors from refactor