backported from ics