added destroy and dirtyflag support