add database and disconected function