changed the listener functions