updated to check for href