fixed a stupid bug in protocol parser