SOLVED - Sending String through SendMessage

Hello Unity Community,

I spent hours googling to find a solution to a SendMessage problem. Please give me a hint what can be wrong with this:

Script 1, sending a String value:

//HERE pathTOFile is a String
Debug.LogWarning(pathToFile);
plane.SendMessage("MessageReceived",pathToFile);

Script 2, receiving the String value:

function MessageReceived(pathToFile:String){
	
	
			
			Debug.LogWarning(pathToFile);
			if (pathToFile.Length != 0) {
				var www = WWW("file:///" + pathToFile);
				www.LoadImageIntoTexture(texture);
			}
			}

I continously get error message:
InvalidCastException: Cannot cast from source type to destination type.

What is wrong with it? Thank you for any help in advance.

Disregard my question please, making the variable public solved my problem.