Add finally close when exception are raised, to avoid not closed connection