added flag to empty container