backport as done by tabsl