Cherry picked PR by @localheinz

Thanks @localheinz