corrected dsfunction if-clause