Moved server to another thread
Handled null pointers at the end of strings