adding code for favorites