fix selection range bug