ast: fixed hang when checking beid