         form = @sell_form
         $scope.clear_form_errors(form)
         ask = $scope.ask.clone_and_normalize()
-       
+
         #make sure user sees the correct cost (ng-change vrs watch work-around)
         previous = $scope.ask.cost
         $scope.order_change()
-        if previous != $scope.ask.cost 
+        if previous != $scope.ask.cost
             # This can happen if code forgets to update the cost
             form.ask_total.$error.message = 'market.tip.total_cost_updated'
             return

    market_name = $stateParams.name
    promise = MarketService.init(market_name)
    promise.then (market) ->
        $scope.tabs.forEach (tab) -> tab.active = $scope.active_tab(tab.route)
        $scope.market = current_market = market
        $scope.actual_market = market.get_actual_market()
        $scope.market_inverted_url = MarketService.inverted_url

        #make sure user sees the correct cost (ng-change vrs watch work-around)
        previous = $scope.bid.cost
        $scope.order_change()
        if previous != $scope.bid.cost
            # This can happen if code forgets to update the cost
            form.bid_total.$error.message = 'market.tip.total_cost_updated'
            return

        if bid.cost > $scope.account.base_balance
            form.bid_quantity.$error.message = 'market.tip.insufficient_balances'
            return

        bid.type = "bid_order"
        bid.display_type = "Bid"
        # TODO re-poll api for balance instead (see account_balances_observer below)
