avoid thread to be interrupted