backport from em-web