added testing functionality for dialog box, please review