deprecated the hasNext argument