scanDirectory empty path error handle