fix bug on do_heart_beat