fix a bug from recent refactoring - fix chRoot() function location