Added better handler for 500s