backported from Lotus