                     dbg("error -- #{err}")
                     opts.cb(err)
                     return
-                if x.state.state not in ['running', 'starting', 'pending']
+                if x.state?.state not in ['running', 'starting', 'pending']
                     dbg("project not active")
                     opts.cb()
                     return

        if not @logger?
            return ->
        else
            return (args...) => @logger.debug("kucalc.Project('#{@project_id}').#{f}", args...)

    # free -- stop listening for status updates from the database and broadcasting
    # updates about this project.

        if not @logger?
            return ->
        else
            # still need @logger? since it can get cleaned
            # up when Project is being freed.
            return (args...) => @logger?.debug("kucalc.Client.#{f}", args...)

    project: (opts) =>
        opts = defaults opts,
