better logging on failure