Improved query dialog box