Revised 500 error page
More robust code