handle links to folders correctly