fixed null pointer when no metadata is configured