Stop reading from STDIN when not needed