fix exception where setAttribute didn't exist