added showalertforerror method