throw errors on wrong parameters