check for valid values in the constructor