fixed issue with visited