more code on pkg protocol