added declarations of InterruptedException where necessary