implemented heartbeat