fix handling of InterruptedException