added max size and max messages