addressed crash issue #6
Merge pull request #7 from bibanul/master

addressed crash issue #6