after submitting the form, make sure the user is returned to the previously viewed page, not the index page