rewrite after em-sh change