fix 500 on download redirect