fix for registerinstance