Fixed invalid json submit error when form fields were blank