fixed bug where no dead ends were found