Changed the chain of if statements to else-if

This seems to have a noticeable improvement on the speed when browsing back through through the COMM history on slower computers.