Proper Heartbeat function