fix NPE
Merge pull request #253 from patriot1burke/master

fix NPE