refactored server waiting
Merge pull request #16 from zelgerj/master

refactored server waiting