fixed getInstance method