Add listener and other functionality.