add prepareSearch method