Replaced eval with JSON.encode