return error code instead of redirect