Close and disconnect db