move the heartbeat code
fix queue_test
remove useless function