Double_encode now gets passed into function