Prevent undefined variable originalOrders if tags are empty

Prevent undefined variable originalOrders if tags are empty