Parameter validation, needs to be tested