fix json encode array to save to database for basic data