Fix the issue of adding obstacles when the problem is not defined