Update dispose functionality