implement 'listen' and 'waiting' keywords