Fixed bug with link creation