json database copy each time is written