protocal funtion