Adds event listener for refining queries.