Fix a bug on getting folders