use thread sleep instead of IO sleep, as IO sleep appears to have issues on travis