cleaned up try block in heartbeat routine.