cleaning up background.js
fix error msg when devtools is not opened