Adding a cleanup routine