Commented out section for updating admin_orders in database was missing and end statment for the each do.