Fix isInside check