fixed performance issue with integer encoding