fixed a bug in the BED impl