messenger: prevent overflow if the integer is too large