added iterator test for list and bug fix