fix seg. fault
Merge pull request #1 from snoweye/master

fix seg. fault