Converted direcotry to write JSON