Adding verbose logging for the cleanup function