add a time limit to prevent 599 short-write bug