added leaveAllEntities support