modify example file + add exception in case of a bad argument in the constructor