checking for authentication on form submit