Create link function only once.
Merge pull request #13 from eiriksm/bug/linkfunction-once

Create link function only once.