resolved bug when list is empty