Added Updated Code For midway.js