check if role is set before assignment