I keep getting logged out after I click the submit button