set bfs threshold