add timeout on waitFor function. closes #8