working in the listener