Fixed checking for existing links

Signed-off-by: nixnodes <code@nixnodes.net>