wrap after.js in closure to protect global namespace