fix the if block