use function in checkfiles