Implemented deletion in the flush() operation.