added fix for null pointer expection
Merge pull request #272 from sheebans/master

added fix for null pointer expection