fix #270: prevent invalid form submissions