Adds popup box when error occurs