implemented threading and fully connected the database system