blog 30 Implementing  the closeConnection Function