Fix bugs in listener trigger