log error if failed