Works for files in directory but not sub-directories