fix #96

Browser compatibiliy problem with attributes.dy (Firefox 25.0 among others)

Check if attribute exists before setting it.
Merge pull request #97 from supraLalu/master

fix #96 Browser compatibiliy problem with attributes.dy (Firefox 25.0 among others)