adding substring solution