fixing protocol parsing