fix bug caused by heuristic computation taking up all allocated time