assign event to pub