finish the script to dump detail json