Added guard condition for case when order.packages is empty