Add registration of listening and call back

Add registration of listener