adds first security against json errors after reading the data file