fix crash when no metadata