fix for form fields not clearing in certain cases