check in friend function