correcting wadd function logic