fixing double onload issue in sinon.js