FIX: error handling of addFile