Made optional feature work for deep paths