fix handling of CompletionException
merge from master