I added exit conditions for specs in case error occured in js.