fixed bugs with registering metadata