use raise() instead of error()