added check to avoid error in firefox
Merge pull request #1 from ondrejchmelar/master

added check to avoid error in firefox