Close db connection when finished