added 500 error redirecting