             dbg('make sure project is not already opened somewhere')
             opts.database.get_project_host
                 project_id : opts.project_id
-                cb         : (err, x) ->
+                cb         : (err, host) ->
                     if err
                         cb(err)
                     else
-                        if x?.host
+                        if host
                             cb("project already opened")
                         else
                             cb()

            dbg('determine current location of project')
            opts.database.get_project_host
                project_id : opts.project_id
                cb         : (err, x) ->
                    if err
                        cb(err)
                    else
                        source = x?.host
                        if not source
                            cb("project not opened, so can't move")
                        else if source == opts.target

            dbg('check that project is NOT currently opened LIVE')
            opts.database.get_project_host
                project_id : opts.project_id
                cb         : (err, host) ->
                    if err
                        cb(err)
                    else if host
                        cb("project must not be open LIVE")
                    else
                        cb()
