added null termination to server