back-ported missing functions