disconnecting on each query to prevent database locking