fixing bug in read-race condition
must check to see if file is closed before trying to read
better than adding a try-catch clause