added flag and remove feature