JoinRandomRoom failed. Client is on NameServer (must be Master Server for matchmaking)

I keep having This error "JoinRandomRoom failed. Client is on NameServer (must be Master Server for matchmaking) but not ready for operations (State: ConnectingToNameServer). Wait for callback: OnJoinedLobby or OnConnectedToMaster.
UnityEngine.Debug:LogError (object)
Photon.Pun.PhotonNetwork:JoinRandomRoom (ExitGames.Client.Photon.Hashtable,byte,Photon.Realtime.MatchmakingMode,Photon.Realtime.TypedLobby,string,string) (at Assets/Photon/PhotonUnityNetworking/Code/PhotonNetwork.cs:1663)
Photon.VR.PhotonVRManager:_JoinRandomRoom (string,int) (at Assets/Resources/PhotonVR/Scripts/PhotonVRManager.cs:316)
Photon.VR.PhotonVRManager:JoinRandomRoom (string,int) (at Assets/Resources/PhotonVR/Scripts/PhotonVRManager.cs:293)
Photon.VR.PhotonVRManagerGUI:OnInspectorGUI () (at Assets/Resources/PhotonVR/Scripts/PhotonVRManagerGUI.cs:39)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
" whenever i try to join a lobby. When i start up my game i dont join a lobby even though join room on connection is on. So i go to the photon vr manager and click off then start my game again, then i click join and it says the error. the client is on nameserver. I need help.