Fix bug preventing correct form submission