init listeners in a func