fixed the form submission issue by forcing user to pass in function to directive to submit form