added timeout to readline