Use Rex.sleep instead of sleep