Fixed bug on using set_before_json