close database by overriding the onDestroy()