How to avoid the worst financial outcomes in the mining industry