Handled mysql close in database.js