added condition which check if number of parameters are correct