Added checking text file function.