changes done to have local and remote databases
- take care of remote database disconnection