Added function to increase the maximum number of redirects to 500.