moved javascript for favoriting dreams to separate js file