Adding next and isDet