added fix for handling wait until done exception