fix error handling in goredirect