change the new comer as well as the leaving mechanism and some change in the heartbeat
fix bug