wrap db connection in try/finally to close it