fix the double if