Problems with javascript snippet to redirect page after thank you message