Corrected getInstance method