added functionality for json output