corrected substr_count usage