change the logic of self & parent directory option