Fixed bug that could potentially occur in PhantomJS if the session isn't cleaned up in time