Check the error with GetLastError