Fixed typo on the subString method
fixed null pointer exception if declaration cannot be determined