validate number of arguments