check for error from bufio.Peek