fix bugs in content_script and background messaging