params.parse method executing multiple times after redirect - TanStack