Critical patch: fixed bug when ROOT doesn't exist