added function json_encode