fix stack overflow by listener