Adding support for max messages on chat div