Added an if statement to test whether or not a file is readable