Check if the end is reached when navigating