fix StartsWith and EndsWith error
fix bugs