fix user iteration bugs which skipped the first two users for lua