fix bug, add the missing nItems variable.