Controller runs before .run

Hello i have this issue, i declare a localstorage variable like this:

.run(function($ionicPlatform, $rootScope, $localstorage) {
  $ionicPlatform.ready(function() {
    $localstorage.setObject('global', {
        urlService: "",
        rangoDistancia:  0.089831

    if (window.cordova && window.cordova.plugins.Keyboard) {

    if (window.StatusBar) {
      // org.apache.cordova.statusbar required

it supose when first run and when the platform is ready set the variable, then the controller can read the value, but is empty, i need to close the app and open again and then the values are set, please if some one can tell me what i’m doing wrong, thanks.