fixed a bug in get_beats