(#2497) - fix attachments in Chrome and IE

Yes, this is really what we have to do to get it to pass in IE. I'm sorry.
changed `setImmediate` to `process.nextTick`. `setImmediate` is great, but it's not implemented in every browser