fixed: getInstance now sets $instance