Fixing error with function to generate order_id