Checking for href's undefined value