Added dynamic behavior to prevent empty orders from being created