added check for parameters in our functions