replace alert type from error to warning