fixed bug to do with closing certain tags in proxy