added confirm and error message