Use list instead of generator for loop fix