fixed bug in get_beats