Added close statements to fix memory leak.
Server kept crashing due to OutOfMemoryException.