prevent errors when bad params are submitted

I had some errors in my production system due to this.