getLastError fix