set up spin.js to return spinner inside anonymous function