fixed lastVisited to update automatically