check game object is not undefined