fixes a bug that prevented the directory from being examined more than once