removed a head and a tail for string substitution