dir entering and exiting working, except for rootpath bug