Corrected a syntax error on substring method