Merge pull request #22 from mibrahim/master

Add exitFlag. Don't exit early, and don't block forever