fixed and added debug code around signal blocking and unblocking