Register the listener