more robust error checking for comment box