write user directory to a json file