Added auto destroy functionality