Added error dialog and disabling button after clicking