File wasn't saved yet at the point where I was trying to convert it to json, so now we save it before doing anything else