modifying setToLast method of QuerySelector