replace raise with fail