fixing crash when adding url links under certain conditions