better path checking for hidden files