Added logic to avoid linking to non-URLs