handle empty links, fixed #9