removed substring and used regexp