fixed Subdir index out of range error