Added dispose fuction.