url encode code before sending to validator