Handled the outer path as well, unsure if its correct though?