Fix error when order is nil