update connection code
update finaliser log and fixed db schema