fix extraction to write to jsonout