add signal handler to close DB