Added dispose() function.