added diagnostic output for heartbeat