fixed stats, and better 500 error page