trying to add a cleanup routine