fix bug in timeout loop and add support for wait times per kill signal