use double buffering and delete died code