using for loop in Messenger class