added cleanpath to substitution