fixed creation and deletion of empty groups when there are not yet items