fix bdi length bug