fix the bug with subString