better error handling that deletes failed order