bugfix on protocol_number function