Create waitfor.js