added error handling to cope with missing files - normal function currently disabled