add fallback for when element.className is undefined