close connection to database