Adding a dispose method for cleanup.