fix bug for XE 16 and larger