fix a range bug