         dbg()
         @_action
             action : 'stop'
-            wait   : (project) -> project.state?.state in ['opened', 'closed']
+            wait   : (project) -> project.getIn(['state', 'state']) in ['opened', 'closed']
             cb     : cb
 
     # this is a no-op for Kubernetes; this was only used for serving

            cb         : undefined
        dbg = @dbg("restart")
        dbg()
        @_action
            action : 'restart'
            goal   : (project) -> project.action_request?.finished
            force  : true
            cb     : opts.cb

    ensure_running: (opts) =>
        @start(opts)  # it's just the same

        dbg()
        @_action
            action : 'start'
            goal   : (project) -> project.getIn(['state', 'state']) == 'running'
            cb     : cb

    restart: (opts) =>
