add check for href is None to make more robust