Rewrote listener class