Bug fix for submiting form and getting right action type