added heartbeat stuff