restructured files and added error file