Fixed exception when no possible solution