need to define UserError before call