Thank you page redirection not working as intended