replaced deprecated methods in background.js