update to favorites.js, fixed redirect stack overflow