fix ref toString where fn was stringified as [Object]