fix for null pointer
Merge pull request #110 from vomikan/master

fix for null pointer