Made filtered json write optional