Cleaned up a little bit. Showed dialog for error message and confirmation.