fixes #496 and also stops double url encoding links