mod ghost.js for legacy