How I can redirect users to the previous page after the submission?