added type-casting code for viewFavorites
added type-casting code for viewFavorites