added dispose() function