fixed a infinite looping check if given a number too large