Check chrome.runtime.lastError to fix error in chrome.runtime.lastError