correct ENDWITH_* handling