search moved to different function