small changes to frogiter (close stdin)