added interactive debug mode