Solves bug calculating level
Change getHTMLMessages() to use arrays