check that the parameters are valid