adding new exception for invalid file contents updated reader and writer tests