adding heartbeat functions