change method to check substring