fixed stdin issue