implement connectdb, add search bar