Add dispose function.