Fixed crash on exit of second instance