added protocol parsing