Fix: check instance for NULL