fixed stdin for hist