fix json_encode call for php 5.3