added maxline and listenq for listen and readline