fixed add element bug

fixed bug that doesn't add elements when number of items in list are 0