fix getLastError for new interface