make resize work in emscripten