added status bit check in debug code