Client is on MasterServer (must be Master Server for matchmaking)but not ready for operations

Help!!
I have looked everywhere but cannot find a solution.
I'm trying to make a super simple multiplayer game, but this error come up when I attempt to connect to a room: Client is on MasterServer (must be Master Server for matchmaking)but not ready for operations (State: Joining). Wait for callback: OnJoinedLobby or OnConnectedToMaster.

This is my code for a loading scene which when it connects sends you to a lobby, where it attempts to send you to a room.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Photon.Pun;
using UnityEngine.SceneManagement;

public class ConnectToServer : MonoBehaviourPunCallbacks
{
// Start is called before the first frame update
void Start()
{
PhotonNetwork.ConnectUsingSettings();
}

public override void OnConnectedToMaster()
{
PhotonNetwork.JoinLobby();
}

public override void OnJoinedLobby()
{
SceneManager.LoadScene("Lobby");
}

}

And here is the lobby code

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using Photon.Pun;

public class CreateAndJoinRooms : MonoBehaviourPunCallbacks
{

private void Awake()
{
PhotonNetwork.AutomaticallySyncScene = true;
}
public void CreateRoom()
{
PhotonNetwork.CreateRoom("Room");
}

public void JoinRoom()
{
if (PhotonNetwork.IsConnected)
{
PhotonNetwork.JoinRoom("Room");
}

}

public override void OnJoinedRoom()
{
PhotonNetwork.LoadLevel("Game");
}
}