Update main.cpp

Segmentation fault anyone? ;)
Merge pull request #3 from ofcaah/patch-3

Update main.cpp