fix NPE
Merge pull request #1 from ligi/fix_npe

fix NPE