added cleanup if driver crashed.
Merge pull request #1224 from LorenzoBoccaccia/change-be

added cleanup if driver crashed.