constructor will throw exception when args are not valid