read with timeout