           @errorMsg()
 
       display: ->
-        @view.display(@displayValue())
+        to_disp = @displayValue()
+        @view.display(to_disp)
 
       errorMsg: -> "Error"
 


      displayValue: ->
        if !@current_expression.isError()
          val = @current_expression.display()
          if val.length == 0
            '0'
          else



ttm.define "calculator",
  ["lib/class_mixer", "lib/math", "widgets/ui_elements", "lib/math/buttons", 'lib/math/expression_to_string'],
  (class_mixer, math, ui_elements, math_buttons,
    expression_to_string)->

    open_widget_dialog = (element)->
      if element.empty()
