fix c99
improved chatblock logic