adding function to handle a heartbeat from a client