bug fix for stdio