check for null pointer for ROOTDIR