fix bash substring check