avoiding stockmarket crash error