better setup and tear down of attach.unit.js