Updated background.js to not crash on Android