add upper bound for bfs threshold