Use thread sleep instead