Fix a bug getting folders array