finalizing project, program properly closes connections