Fix use of this keyword in favorites.js