Refactoring magnetic link generation
Bugfix for not working magnetic link