fixed checking the number of params