fixed potential deadlock on error+force closing