Fix logging level
Clear the resource in case of a failure