extended Has function to work with paths