fix node kill bugs and add debugging