Close the hive db connection when exiting
varition offset by 1 bug