backport to gingerbreda