Adding Threading for listen() function