fixed end of input error