checkRange bug fixed