added correct IO.read redirection