backported to gingerbread