update heartbeat routine
better logging