improve function create_link
improved creating links