Create EnsureCorrectPath to handle navigating to correct paths
Refactor code to make use of EnsureCorrectPath