implemented http substitution