remove empty links at end