fix bugs in Cage and new search function