added heartbeating functionality