correct a segfault
Merge pull request #41 from nnayo/segfault

correct a segfault