use closure & callback for shorten.js & fixes