fix infinite loop when path don't exists