I added some logic into the dialog function to protect against
    adding strings which are too large