added logic for init listeners