Fix error in listener