added timeout to read