debugging, fix bug in update/submission waiting

allow a debug function to be set

fix a bug (mangled variable names) in update/submissin waiting