MADS: Implemented more logic for dialog display