I am listing game in my application. Some are paid and some are free so during listing I am calling a method to get price from play store and response getting in Success callback. My problem is my success handler setting price after listing all games so all games are listed as free. My code is

**Listing game**

```
function render(res)
{
    for (var i = 0; i < res.length; i++) {
        var data=res[i];
        if(data.product_id!='Free' && data.product_id!='')
        {
            getDetails(data.product_id);
        }
        else
        {
            price='Free';
        }
        console.log(price);
        var gameOnScreen = "<li class='game-box showlist'  data-tag='" + app_tag + "' >" +
        "<div class='game-box-link' data-id='" + game.ID + "' data-orientation='" + orientation + "' data-ajax='false' data-url='" + link + "' data-transition='none'>" +
        "<img src='" + thumb + "' class='game-thumb'>" +price+
        "</div></li>";
        }
    }
}

```

**Get Detail**

```
function getDetails(productlist)
{
    inappbilling.getProductDetails(successHandler2, errorHandler, productlist);
}

```

**successHandler2**

```
function successHandler2 (result)
{
    price= result[0].price;
    console.log(price);
}

```

[![enter image description here](https://i.stack.imgur.com/ucI9C.png)](https://i.stack.imgur.com/ucI9C.png)

In image you can see price is coming after listing all games.