Attaching the listener on creation.