need to close server properly