refactor search to modal