critical update to open and close DBConnection