fix substr