updated to correctly close the ObjectOutputStream based on guidance from the CERT Java Secure Coding Standard