Added better exit strategy.