fix bug in insideNode()