Handle the indexerror exception on create_order

LMS-2646
why was this moved?