code polishing, fixing chrome background tab problem