testing for file validity and readability