fix lookup modal template and logic