make logic failure fixed