fixing bugs, which were caused my improper querying of database (needed .first for @favorite)