fix for when params come through with similar name as encode_to param name and general more robustness