Add a check if order object is an object and has an id