Fixed a bug in setting protocol id