use logic_error exception