fixed getWidth and getHeight for scripts phase2