Fixed a bug when metada is empty