bug fix on number of parameters check