fix the outOfSize exception