added checks for parameters