Updated example and added freeConnection() method