Add connection close step

To avoid mysql timeout