release connection when using promises