Coding check

I have a char called david with the instance name david2, and he walks around with the arrowkeys. There is a castle in the background and I have a line around it that has the following coding on it :

onClipEvent(load){
if (this.hitTest(_root.david2))
gotoAndPlay(“nearcastle”)
}

I have another frame called nearcastle and when I run into the line nothing happens. Does anyone know why this is ?