fixed the addlistener bug