Corrected the header display logic for some browsers.

Some browsers like Chrome do not support String.endsWith(). Hence,
indexOf is used instead.