implement search but bugs in