add checkParams function