insert connection.close in finally block